package com.aircms.dao;

import com.aircms.pojo.Permission;
import com.aircms.pojo.validation.BaseQueryFieldsValidation;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface PermissionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Permission record);

    int insertSelective(Permission record);

    Permission selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Permission record);

    int updateByPrimaryKey(Permission record);

    int selectByUrlAndMethod(@Param("url") String url, @Param("method") String method);

    List<Permission> selectALl();

    List<Permission> selectPermissionByType( Integer type);

    List<Permission> selectMenuIndex(BaseQueryFieldsValidation baseQueryFields);

    List<Permission> selectRouterIndex(BaseQueryFieldsValidation baseQueryFields);

    /**
     * 根据名称查询菜单权限
     * @param name
     * @return
     */
    int selectMenuPermissionByName(String name);
}